<!DOCTYPE HTML>
<html>
<head>
    {include file="common:meta"}
</head>
<body>

<div class="page-container">
    <div class="float-e-margins">
        <div class="ibox-content">
            <div class="tabs-container">
                <ul class="nav nav-tabs">
                    <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">自定义内容列表</a>
                    </li>
                    <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">自定义内容添加</a>
                    </li>
                </ul>
                <div class="tab-content">
                    <div class="tab-pane active" id="tab-1">
                        <input type="hidden" value="{$data['f_user_id']}" id="f_user_id"/>
                        <div style="text-align:center;font-size:20px;">
                            手机号用户总数：{$data['u_count']},总记录数：{$data['total_user']},用户邀请有效率：{$data['ratio']}(仅供参考)
                        </div>
                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th>用户ID</th>
                                <th>用户名</th>
                                <th>第三方来源</th>
                                <th>金钱</th>
                                <th>金币</th>
                                <th>钻石</th>
                                <th>注册来源</th>
                                <th>登录开源</th>
                                <th>上次登陆时间</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="data" key='key' id="list"}
                            <tr>
                                <td>{$list.u_id|default='无'}</td>
                                <td>{$list.nickname|default='无'}</td>
                                <td> {$list.u_phone|default='无'}--{$list.oauth|default='无'}</td>
                                <td>{$list.money|default='无'}</td>
                                <td>{$list.gold|default='无'}</td>
                                <td>{$list.diamonds|default='无'}</td>
                                <td>{$list.source_register|default='无'}</td>
                                <td>{$list.source_login|default='无'}</td>
                                <td>{$list.last_login|default='无'}</td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                    </div>
                    <div class="tab-pane" id="tab-2">
                        <table class="table table-bordered">
                            <thead id="info-t">

                            </thead>
                            <tbody id="info">

                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="common:footer"}

<script>
    window.onload = getData();
    //获取收入数据
    function getData(){
        var f_user_id = $('#f_user_id').val();
        var datas = {
            f_user_id:f_user_id
        };
        $.ajax({
            type:'get',
            url:'/IntroduceAllMember',
            data:datas,
            dataType:'json',
            success:function(result){
                //console.log(result);
                if(result.resultCode == 100){

                    var htmlInfo = "<tr><th>"+'用户ID'+"</th><th>用户名</th><th>第三方来源</th><th>金钱</th><th>金币</th><th>钻石</th><th>注册来源</th><th>登录开源</th> <th>上次登陆时间</th></tr>";
                    var htmlElement = '',data = result.resultData;
                    for(var i in data){
                        htmlElement += "<tr><td>"+ data[i].u_id + "</td><td>"+ data[i].nickname +"</td><td>"+data[i].u_phone +"-"+data[i].oauth +"</td><td>"+data[i].money +"</td><td>"+data[i].gold +"</td><td>"+data[i].diamonds +"</td><td>"+data[i].source_register + "</td><td>"+data[i].source_login + "</td><td>"+data[i].last_login + "</td></tr>";
                    }
                    $('#info').html(htmlElement);
                    $('#info-t').html(htmlInfo);
                }
                else{
                    $('#info').empty();
                }
            },
            error:function(err){
                layer.msg('服务器开小差了！',{
                    time:2000
                });
            }
        });
    }
</script>
</body>
</html>